r = 1 gottray = 1 alien = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 8) AS STRING directions(1) = "EAST" directions(2) = "WEST OR SOUTH" directions(3) = "NORTH OR EAST" directions(4) = "EAST OR WEST" directions(5) = "NORTH, WEST, OR EAST" directions(6) = "SOUTH" directions(7) = "WEST OR SOUTH" directions(8) = "NORTH" PRINT "" PRINT "" PRINT "You find yourself standing in a white room, void of any items, but a metal" PRINT "tray, and while you have taken it. Thoughts began to race through your mind" PRINT "as to where you are? All you could remember was that you were fishing and" PRINT "now your here. Just what is going on here?" PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " Abduction " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2015" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gottray = 1 THEN: PRINT "A weightless metal tray." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 3 THEN: r = 2: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 8 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 7: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 7 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 7 THEN: r = 5: GOTO moved IF r = 5 THEN: r = 4: GOTO moved IF r = 4 THEN: r = 3: GOTO moved END IF IF (cmd$ = "USE TRAY") THEN CLS PRINT "On what? There is no one around to use it on. Nor any doors to pry" PRINT "open." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE ALIEN") AND r = 6 THEN CLS PRINT "The being stands at four foot tall. It's pale skin appears to be" PRINT "almost see through. It has no nose, a slit for a mouth, and eye's" PRINT "the size of your fist." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO ALIEN") AND r = 6 THEN CLS PRINT "You try to speak to said being. But it does not respond, but it" PRINT "looks at you with it's head tilted to the left, and blinks." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE TRAY") AND gotknife = 1 THEN CLS PRINT "A weightless metal tray. Nothing like this exists where your from." PRINT "Just who or what has made this?" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "USE TRAY") AND gottray = 1 AND r = 6 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "SURRENDER") AND r = 6 THEN CLS GOTO lose: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing in a small white medical room." RETURN r2: PRINT "The narrow hallway is empty, not a window, or any item of furniture." RETURN r3: PRINT "Silence, it fills the air, and almost seems as if who ever is" PRINT "behind this, doesn't like noise." RETURN r4: PRINT "With every step you take, you notice that it's as if all sound" PRINT "has been muted. You have a bad feeling about this!" RETURN r5: PRINT "You have the feeling of being watched come over you. In the distance" PRINT "you see someone or something going over it's work." RETURN r6: PRINT "A small room, designed and crafted as if for a child. There stands" PRINT "what looks like an alien. You stand in utter shock, fear washes over" PRINT "you." RETURN r7: PRINT "The hallway widens before you." RETURN r8: PRINT "You stand before a large metal door. Alarms begin to sound as the door" PRINT "quickly opens. Revealing that you are indeed outside the Earth's grasp." RETURN win: COLOR 2, 0 CLS PRINT "You swing the tray at the alien being. This breaks the link" PRINT "that it had over you, the calming effect, the fear, it all" PRINT "vanishes from you. Soon the alarm goes off and you quickly" PRINT "run down the hallway and find that the ship has already landed." PRINT "You flee from the ship and find yourself lying in bed. You pull" PRINT "back the blankets and find mud and grass stuck to the bottoms" PRINT "of your feet." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 2, 0 CLS PRINT "You drop the tray and then before you know it. You are straped" PRINT "down to an operating table. Where you are never seen again." PRINT DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You awaken from a deep sleep. What a dream? You say to yourself. You yawn" PRINT "and return to the world of slumber." _DISPLAY END END SUB